import instance from '@/utils/request'
// 获取-分页查询角色列表
export const getRoleList = (params) => {
  return instance.get('/sys/role', { params })
}
// 新增-角色
export const addRole = (data) => {
  return instance.post('/sys/role', data)
}
// 修改
export const updateRole = (data) => {
  return instance.put(`/sys/role/${data.id}`, data)
}
// 删除
// export const deldata
export const delRole = (id) => {
  return instance.delete(`/sys/role/${id}`)
}
//
export const getEnableRoleList = () => {
  return instance.get('/sys/role/list/enabled')
}
//  角色权限分配
export const assignRoles = (data) => {
  return instance.put('/sys/role/assignPrem', data)
}

//
export const getRoleDetail = (id) => {
  return instance.get(`/sys/role/${id}`)
}
export const assignPrem = (data) => {
  return instance.put('/sys/role/assignPrem', data)
}
